{# On �tend notre layout #}
{% extends "::base.html.twig" %}

{# Dans notre layout, il faut d�finir le block body #}
{% block bundleContent %}

    {% block content %}

	<!-- BEGIN CONTENT WRAPPER -->
	<div id="content-wrapper" class="content-wrapper">
		<div class="container">
			<div class="clearfix">
						
				<div id="grid_9">
					{% for flashMessage in app.session.flashbag.get('notice') %}
						{{ flashMessage }}
					{% endfor %}
				</div>

				<div class="grid_9">
					Manage the event "{{ event.evtTitle }} ({{event.evtPlannedDate|date("m/d/Y")}})" 
				</div>
				<div class="grid_3">
					{{ event.evtMoneyAmount }}&euro;
				</div>
				<div class="grid_12">
					{{ event.evtDescription }}
				</div>
				
				<div class="grid_12">
				  <div id="calendar">
				  </div>
				</div>
			</div>
			<!-- <div class="hr"></div> -->
		</div>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
		  $('#calendar').fullCalendar({
				lang: 'fr',
				eventSources: [{
					events: [
						{% for vote in votes %}
							{
							title: '{{ vote.votName }}',
							start: '{{vote.votDate|date("Y-m-d")}}'
							},
						{% endfor %}
						{
						title: 'Planned date',
						start: '{{event.evtPlannedDate|date("Y-m-d")}}',
						color: 'green',
						textColor: 'white'
						}
					]
				}]
		  });
		  
		  $('#calendar').fullCalendar('gotoDate', '{{event.evtPlannedDate|date("Y-m-d")}}');
		});
	</script>

	{% endblock %}

{% endblock %}